'https://www.jizhy.com/44/rank/school'

import requests
import json
import time
import hashlib


def get_sign(param):
    # 计算 MD5 哈希
    md5_hash = hashlib.md5(param.encode()).hexdigest()

    # 转换为大写
    md5_hash_upper = md5_hash.upper()
    return md5_hash_upper


headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36',
}

params = {
    'page': '1',
    'page_len': '20',
    'diploma_id': '7',
    'wenli': '0',
    'app_id': '98357f659cf8fb6001cff80f7c6b85f2',
    'ts': int(time.time() * 1000),
    'platform': 'desktop',
    'v': '210',
}
key_param = '146fd1e66513611ac7af69f21f1d7725'
# sorted_params = '&'.join(f"{k}={v}" for k, v in sorted(params.items()))
# result = f"{{{sorted_params}}}&key={key_param}"
# sign = get_sign(result)
# params['sign'] = sign
# response = requests.get('https://www.jizhy.com/open/sch/rank-list', params=params, headers=headers)
# print(response.text)
